package metaballs;

import java.awt.Dimension;
import java.nio.FloatBuffer;

import util.Vec2I;
import util.texture.StockTextureFactory;
import util.texture.textureGenerators.BaseFloatTextureDataGenerator;

import com.sun.opengl.util.texture.Texture;

public class MetaBallTexture
{
    private final float integral;
    private final Texture texture;

    public MetaBallTexture(Dimension dimension, BaseFloatTextureDataGenerator generator)
    {
        FloatBuffer metaballTextureData = generator.generate(dimension);
        this.integral = generator.getIntegral();
        this.texture = StockTextureFactory.createFloatingPointTexture(dimension, true, true, metaballTextureData);
    }
    
    public Texture getTexture()
    {
        return texture;
    }

    public float getIntegral()
    {
        return integral;
    }
}
